﻿<!--<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="CaptionButtons.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="ChromelessWindow" TargetType="Window">
        <Setter Property="Template">
            <Setter.Value>-->

            <!-- 
             Template to use when the Window's chrome is gone.
             This is generally similar to the standard Window template, 
             but it allows drawing everywhere on the client. -->
                <ControlTemplate 
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:huddled="http://schemas.huddledmasses.org/wpf"
                    TargetType="{x:Type Window}">
                    <ControlTemplate.Resources>
        <!-- Close Button Style -->
        <Style x:Key="SimpleButton" TargetType="{x:Type Button}">
            <Setter Property="MinHeight" Value="24"/>
            <Setter Property="MinWidth" Value="24"/>
            <!--Margin="0" Padding="0" Width="22" Height="22"-->
            <Setter Property="Background" Value="{StaticResource GrayBrush1}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="grid" Cursor="{TemplateBinding Cursor}" Margin="0,0,0,0">
                            <Grid.Background>
                                <SolidColorBrush Color="{TemplateBinding Background}"/>
                            </Grid.Background>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="{StaticResource HighlightLightColor}" Storyboard.TargetProperty="(SolidColorBrush.Color)" Storyboard.TargetName="ContentPresenterWrapperColor" />
                                            <ColorAnimation Duration="0" To="{StaticResource Gray5}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="grid" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="{StaticResource Gray5}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="grid"/>
                                            <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOverlay">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <TextBlock x:Name="UnderlineTextBlock" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}" TextDecorations="Underline" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <TextBlock.Foreground>
                                <SolidColorBrush Color="{StaticResource HighlightDarkColor}"/>
                            </TextBlock.Foreground>
                            </TextBlock>
                            <TextBlock x:Name="DisabledOverlay" Foreground="{StaticResource DisabledForegroundBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Text="{TemplateBinding Content}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Panel.ZIndex="1"/>
                            <ContentControl>
                                <ContentControl.Foreground>
                                    <SolidColorBrush x:Name="ContentPresenterWrapperColor" Color="{StaticResource HighlightDarkColor}" />
                                </ContentControl.Foreground>
                                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Width="21" Margin="0,0,0,0"/>
                            </ContentControl>
                            <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" StrokeThickness="1">
                                <Rectangle.Stroke>
                                    <SolidColorBrush Color="{StaticResource HighlightLightColor}"/>
                                </Rectangle.Stroke>
                            </Rectangle>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="UseLayoutRounding" Value="False"/>
        </Style>
    </ControlTemplate.Resources>
                    <!-- Create the Canvas with dimensions that span the full size of the Window. -->
                    <Canvas x:Name="PART_RootCanvas"
                      Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=ActualWidth}"
                      Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=ActualHeight}"
                      Background="Transparent">
                        <!--<Grid Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=ActualWidth}"
              Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=ActualHeight}"
              Background="Transparent" Margin="0,0,0,0">-->
                        <Border x:Name="PART_BackgroundBorder"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}, Path=Height}"
                            Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}, Path=Width}"/>
                        <Grid>
                            <AdornerDecorator x:Name="PART_Adorner"
                                Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}, Path=Height}"
                                Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}, Path=Width}">
                                <ContentPresenter/>
                            </AdornerDecorator>
                            <Border Style="{DynamicResource PlexiGlass}" Background="Transparent" 
                                BorderBrush="#52FFFFFF" BorderThickness="0,.5,.5,.5" CornerRadius="0,0,4,4" 
                                HorizontalAlignment="Right" VerticalAlignment="Top" 
                                Height="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonHeightKey}}"
                                Margin="0,0,8,0" Padding="0">
                                <Border Background="Transparent"
                                    BorderBrush="#FF000000" BorderThickness="0,.5,.5,.5" 
                                    CornerRadius="0,0,4,4" Padding="0" Margin="0">
                                    <StackPanel x:Name="WindowTools" Orientation="Horizontal" HorizontalAlignment="Right" huddled:CustomChrome.HitTestable="True">
                                        <Button Foreground="White" x:Name="MinimizeButton" ToolTip="Minimize" Style="{StaticResource SimpleButton}" >
                                            <Grid>
                                                <Path Data="M0,10 L18,10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Stretch="Fill" Stroke="{StaticResource ForegroundBrush}" StrokeThickness="4" Height="6" Margin="0,0,0,3"/>
                                            </Grid>
                                        </Button>
                                        <Button Foreground="White" x:Name="MaximizeButton" ToolTip="Maximize" Style="{StaticResource SimpleButton}" >
                                            <Grid>
                                                <Rectangle Height="14" StrokeStartLineCap="Triangle" StrokeEndLineCap="Triangle" Stroke="{StaticResource ForegroundBrush}" StrokeThickness="2" Width="14"/>
                                                <Path Data="M0,10 L18,10" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Fill" Stroke="{StaticResource ForegroundBrush}" StrokeThickness="2" Height="6" Width="14" Margin="3,7,0,0"/>
                                            </Grid>
                                        </Button>
                                        <Button Foreground="White" x:Name="CloseButton"    ToolTip="Close"    Style="{StaticResource SimpleButton}" >
                                            <Grid>
                                                <Path Data="M8.625,8.375 L29.5,29.75" Height="14" Width="14" Stretch="Fill" Stroke="{StaticResource ForegroundBrush}" StrokeThickness="2" StrokeEndLineCap="Triangle" StrokeStartLineCap="Triangle"/>
                                                <Path Data="M17.375,0 L1.625,16.25" Height="14" Width="14" Stretch="Fill" Stroke="{StaticResource ForegroundBrush}" StrokeThickness="2" StrokeEndLineCap="Triangle" StrokeStartLineCap="Triangle" />
                                            </Grid>
                                        </Button>
                                    </StackPanel>
                                </Border>
                            </Border>
                        </Grid>
                        <ResizeGrip HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="Collapsed" IsTabStop="False"/>
                    </Canvas>
                    <!--</Grid>-->
                </ControlTemplate>
            <!--</Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>-->